#!/bin/bash

echo "Adding testframework to Puppetfile"    
wget https://rely-testframe.googlecode.com/git/Puppetfile -O /tmp/Puppetfile-testframework
cp /etc/puppet/Puppetfile /tmp/Puppetfile-org
sort /tmp/Puppetfile-org /etc/puppet/Puppetfile /tmp/Puppetfile-testframework | uniq > /etc/puppet/Puppetfile

echo "Installing testframework module dependencies"
  PUPPETFILE=/etc/puppet/Puppetfile \
PUPPETFILE_DIR=/etc/puppet/modules \
r10k puppetfile install

echo "Apply dev_testframe::init.pp"
puppet apply /etc/puppet/modules/dev_testframe/manifests/init.pp

# echo "> Generating jenkins slave jobs/"
# puppet apply tests/jenkins-jobs.pp
